<?php
$this->breadcrumbs = array(
    'Directors' => array('index'),
    $model->id => array('view', 'id' => $model->id),
    'Update',
);

$this->menu = array(
    array('label' => 'List Director', 'url' => array('index')),
    array('label' => 'Create Director', 'url' => array('create')),
    array('label' => 'View Director', 'url' => array('view', 'id' => $model->id)),
    array('label' => 'Manage Director', 'url' => array('admin')),
);
?>

<h1>Update Director <?php echo $model->id; ?></h1>

<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'director-form',
    'enableAjaxValidation' => false,
        ));
?>

<p class="help-block">Fields with <span class="required">*</span> are required.</p>

<?php echo $form->errorSummary($model); ?>

<?php echo $form->textFieldRow($model, 'name_vn', array('class' => 'span5', 'maxlength' => 100)); ?>

<?php echo $form->textFieldRow($model, 'name_en', array('class' => 'span5', 'maxlength' => 100)); ?>

<?php echo $form->textFieldRow($model, 'link', array('class' => 'span5', 'maxlength' => 100)); ?>

<?php echo $form->textAreaRow($model, 'about', array('rows' => 6, 'cols' => 50, 'class' => 'span8')); ?>

    <?php echo $form->dropDownListRow($model, 'status', array(1 => 'Hiện', 0 => 'Ẩn')); ?>

<div class="form-actions">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType' => 'submit',
        'type' => 'primary',
        'label' => $model->isNewRecord ? 'Create' : 'Save',
    ));
    ?>
</div>

<?php $this->endWidget(); ?>
<script type="text/javascript">
    var editor = CKEDITOR.replace('Director[about]', {
        skin: 'moono',
        toolbar: [
            {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike']},
            {name: 'aligh', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']},
            {name: 'basicstyles1', items: ['Subscript', 'Superscript']},
            {name: 'paragraph', items: ['NumberedList', 'BulletedList']},
            {name: 'paragraph', items: ['Outdent', 'Indent', '-', 'Blockquote']},
            {name: 'links', items: ['Link', 'Unlink']},
            {name: 'document', items: ['Source']},
            '/',
            {name: 'styles', items: ['Font', 'FontSize']},
            {name: 'colors', items: ['TextColor', 'BGColor']},
            {name: 'insert', items: ['Iframe', 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar']},
            {name: 'editing', items: ['Find', 'Replace', 'RemoveFormat']},
            {name: 'tools', items: ['Maximize', 'ShowBlocks']}
        ]
    });
    CKEDITOR.config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';
    CKEDITOR.on('instanceReady', function(e) {
        var editor = e.editor;
        editor.on('paste', function(e) {
            setTimeout(function() {
                editor.focus();
                editor.document.$.execCommand('SelectAll', false, null);
                editor.execCommand('removeFormat', editor.selection);
            }, 0);
        });
    });

</script>